package ${configs.packagePath}.common;

import ${configs.packagePath}.exception.CustomException;
import ${configs.packagePath}.utils.ValidateUtils;
import org.springframework.beans.factory.annotation.Autowired;

import javax.validation.Validator;

/**
 * <Description>
 * 基础的处理器
 * @author Jun Lee
 * @version 1.0
 * @createDate ${date}
 */
public abstract class BaseController {
    @Autowired
    private Validator validator;

    /**
     * 验证请求参数
     * @param object
     */
    public void checkRequestParam(Object object) throws CustomException {
        ValidateUtils.validate(object, validator);
    }
}
